<template>
  <el-scrollbar height="75vh">
    <el-card>
      <el-descriptions class="margin-top" border title="企业信息:">
        <template #extra>
          <el-button
            style="margin-right: 20px"
            type="primary"
            @click="changeProject"
            >切换项目</el-button
          >
        </template>
        <el-descriptions-item>
          <template #label>
            <div class="cell-item">
              <el-icon>
                <user />
              </el-icon>
              营业执照
            </div>
          </template>
          <img
            src="https://export.bknykf.com/profile/upload/bkreg/2022/04/24/d64a050e-18fa-415d-b3cd-812b25ea8b32.jpg"
            class="file-preview-image kv-preview-data"
            title=""
            alt=""
            style="
              width: 200px;
              height: 250px;
              max-width: 100%;
              max-height: 100%;
            "
          />
        </el-descriptions-item>
      </el-descriptions>
      <el-descriptions class="margin-top" border>
        <el-descriptions-item>
          <template #label>
            <div class="cell-item">
              <el-icon>
                <user />
              </el-icon>
              统一社会信用代码
            </div>
          </template>
          {{ proInfo.uscCode }}
        </el-descriptions-item>
        <el-descriptions-item>
          <template #label>
            <div class="cell-item">
              <el-icon>
                <iphone />
              </el-icon>
              法人代表
            </div>
          </template>
          {{ proInfo.coRepr }}
        </el-descriptions-item>
        <el-descriptions-item>
          <template #label>
            <div class="cell-item">
              <el-icon>
                <location />
              </el-icon>
              单位名称
            </div>
          </template>
          {{ proInfo.coName }}
        </el-descriptions-item>
        <el-descriptions-item>
          <template #label>
            <div class="cell-item">
              <el-icon>
                <tickets />
              </el-icon>
              单位类型
            </div>
          </template>
          <el-tag size="small">
            {{ proInfo.coType }}
          </el-tag>
        </el-descriptions-item>
        <el-descriptions-item>
          <template #label>
            <div class="cell-item">
              <el-icon>
                <office-building />
              </el-icon>
              是否公共机构
            </div>
          </template>
          <div v-if="proInfo.pubIns == 0">
            <el-tag size="small" type="danger">否</el-tag>
          </div>
          <div v-else>
            <el-tag size="small">是</el-tag>
          </div>
        </el-descriptions-item>
        <el-descriptions-item>
          <template #label>
            <div class="cell-item">
              <el-icon>
                <office-building />
              </el-icon>
              邮编
            </div>
          </template>
          {{ proInfo.posCode }}
        </el-descriptions-item>
        <el-descriptions-item span="1">
          <template #label>
            <div class="cell-item">
              <el-icon>
                <office-building />
              </el-icon>
              行政区划代码
            </div>
          </template>
          {{ proInfo.areaCode }}
        </el-descriptions-item>
        <el-descriptions-item span="3">
          <template #label>
            <div class="cell-item">
              <el-icon>
                <office-building />
              </el-icon>
              地址
            </div>
          </template>
          {{ proInfo.coAddr }}
        </el-descriptions-item>

        <el-descriptions-item span="1">
          <template #label>
            <div class="cell-item">
              <el-icon>
                <office-building />
              </el-icon>
              注册资金(万)
            </div>
          </template>
          {{ proInfo.regCapital }}
        </el-descriptions-item>
        <el-descriptions-item span="3">
          <template #label>
            <div class="cell-item">
              <el-icon>
                <office-building />
              </el-icon>
              注册地址
            </div>
          </template>
          {{ proInfo.regAddr }}
        </el-descriptions-item>
        <el-descriptions-item>
          <template #label>
            <div class="cell-item">
              <el-icon>
                <office-building />
              </el-icon>
              联系电话（法人）
            </div>
          </template>
          {{ proInfo.reprPhone }}
        </el-descriptions-item>
        <el-descriptions-item>
          <template #label>
            <div class="cell-item">
              <el-icon>
                <office-building />
              </el-icon>
              电子邮箱（法人）
            </div>
          </template>
          {{ proInfo.reprEmail }}
        </el-descriptions-item>
        <el-descriptions-item>
          <template #label>
            <div class="cell-item">
              <el-icon>
                <office-building />
              </el-icon>
              行业编码
            </div>
          </template>
          {{ proInfo.indCode }}
        </el-descriptions-item>
        <el-descriptions-item>
          <template #label>
            <div class="cell-item">
              <el-icon>
                <office-building />
              </el-icon>
              能耗级别
            </div>
          </template>
          {{ proInfo.eneLevel }}
        </el-descriptions-item>
        <el-descriptions-item>
          <template #label>
            <div class="cell-item">
              <el-icon>
                <office-building />
              </el-icon>
              是否能源加工转换种类企业
            </div>
          </template>
          <div v-if="proInfo.energyProces == 0">
            <el-tag size="small" type="danger">否</el-tag>
          </div>
          <div v-else>
            <el-tag size="small">是</el-tag>
          </div>
        </el-descriptions-item>
        <el-descriptions-item>
          <template #label>
            <div class="cell-item">
              <el-icon>
                <office-building />
              </el-icon>
              注册日期
            </div>
          </template>
          {{ proInfo.regDt }}
        </el-descriptions-item>
        <el-descriptions-item>
          <template #label>
            <div class="cell-item">
              <el-icon>
                <office-building />
              </el-icon>
              领域编码
            </div>
          </template>
          {{ proInfo.domCode }}
        </el-descriptions-item>
        <el-descriptions-item>
          <template #label>
            <div class="cell-item">
              <el-icon>
                <office-building />
              </el-icon>
              主要厂址中心经度
            </div>
          </template>
          {{ proInfo.longitude }}
        </el-descriptions-item>
        <el-descriptions-item>
          <template #label>
            <div class="cell-item">
              <el-icon>
                <office-building />
              </el-icon>
              主要厂址中心纬度
            </div>
          </template>
          {{ proInfo.latitude }}
        </el-descriptions-item>

        <el-descriptions-item>
          <template #label>
            <div class="cell-item">
              <el-icon>
                <office-building />
              </el-icon>
              是否央企
            </div>
          </template>
          <div v-if="proInfo.centrEnt == 0">
            <el-tag size="small" type="danger">否</el-tag>
          </div>
          <div v-else>
            <el-tag size="small">是</el-tag>
          </div>
        </el-descriptions-item>
        <el-descriptions-item>
          <template #label>
            <div class="cell-item">
              <el-icon>
                <office-building />
              </el-icon>
              传真
            </div>
          </template>
          {{ proInfo.fax }}
        </el-descriptions-item>
        <el-descriptions-item>
          <template #label>
            <div class="cell-item">
              <el-icon>
                <office-building />
              </el-icon>
              单位网站地址
            </div>
          </template>
          {{ proInfo.coWeb }}
        </el-descriptions-item>
        <el-descriptions-item>
          <template #label>
            <div class="cell-item">
              <el-icon>
                <office-building />
              </el-icon>
              主导产品
            </div>
          </template>
          {{ proInfo.products }}
        </el-descriptions-item>
        <el-descriptions-item>
          <template #label>
            <div class="cell-item">
              <el-icon>
                <office-building />
              </el-icon>
              集团名称
            </div>
          </template>
          {{ proInfo.groupName }}
        </el-descriptions-item>
        <el-descriptions-item>
          <template #label>
            <div class="cell-item">
              <el-icon>
                <office-building />
              </el-icon>
              主要生产线名称
            </div>
          </template>
          {{ proInfo.plineName }}
        </el-descriptions-item>
        <el-descriptions-item>
          <template #label>
            <div class="cell-item">
              <el-icon>
                <office-building />
              </el-icon>
              集团地址
            </div>
          </template>
          {{ proInfo.groupAddr }}
        </el-descriptions-item>
      </el-descriptions>
    </el-card>
  </el-scrollbar>
</template>

<script setup>
import mitts from "@/utils/bus.js";
import { defineProps, onBeforeMount, reactive } from "vue";
import { getrega } from "@/api/energySystem";
const prop = defineProps({
  enterpriseCode: String,
});

const getEnterInfo = () => {};
let proInfo = reactive({});
/**
 * 兄弟组件传参
 */
const changeProject = () => {
  let show = true;
  mitts.emit("show", show);
};
onBeforeMount(() => {
  mitts.on("projectId", (e) => {
    let datas = {
      id: e,
    };
    getrega(datas)
      .then((res) => {
        Object.assign(proInfo, res.data);
      })
      .catch((msg) => {});
  });
});
getEnterInfo();
</script>

<style lang="less" scoped></style>
